var t = getApp(), a = 2 * t.globalData.statusBarHeight + 20;

Page({
    data: {
        statusBarHeight: a,
        page: 1
    },
    onLoad: function(t) {
        this.getdata();
    },
    back: function() {
        wx.navigateBack({
            delta: 1
        });
    },
    godetail: function(t) {
        console.log(t);
        var a = t.currentTarget.dataset.item.id, e = t.currentTarget.dataset.item.questionnaire_id;
        wx.navigateTo({
            url: "/packageE/questionnaire/history_details/history_details?id=" + a + "&questionnaire_id=" + e
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.current_page >= this.data.last_page)) {
            var t = this.data.page + 1;
            this.setData({
                page: t
            }), this.getMore();
        }
    },
    onShareAppMessage: function() {},
    getdata: function() {
        var a = this, e = t.getNetAddresss("plugin.questionnaire.api.index.indexInfo");
        t._getNetWork({
            url: e,
            data: {
                record: "record",
                page: this.data.page
            },
            success: function(t) {
                var e = t.data;
                console.log(e), 1 == e.result ? a.setData({
                    list: e.data.record.list.data,
                    current_page: e.data.record.list.current_page,
                    last_page: e.data.record.list.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getMore: function() {
        var a = this, e = t.getNetAddresss("plugin.questionnaire.api.index.indexInfo");
        t._getNetWork({
            url: e,
            data: {
                record: "record",
                page: this.data.page
            },
            success: function(t) {
                var e = t.data;
                console.log(e), 1 == e.result ? a.setData({
                    list: a.data.list.concat(e.data.record.list.data),
                    current_page: e.data.record.list.current_page,
                    last_page: e.data.record.list.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    }
});